/**
 * Copyright (C) 2013-2014 the original author or authors.
 */
package com.foreveross.bsl.mdm.model.ios.domain;

import java.util.Date;

import org.springframework.data.annotation.Id;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import com.foreveross.bsl.mongodb.domain.Entity;

/**
 * @description
 * 
 * @author heyaowen
 * @version v1.0
 * 
 * @2014-7-18
 * 
 */
@Document(collection = "mdmEnrollment")
public class MdmEnrollment extends Entity {

	@Id
	private String id;

	@Field("udid")
	private String udid;

	@Field("topic")
	private String topic;
	
	@Field("pushMagic")
	private String pushMagic;
	
	@Field("byteToken")
	private byte[] byteToken; // plist中要转成16进制字符串
	
	@Field("token")
	private String token; // byteToken 解码后的token
	
	@Field("unlockToken")
    private byte[] unlockToken; // 清除密码必要值: base64 解码
	
	@Field("create_date")
	private Date create_time; /** 创建时间 */
	
	@Field("modified_time")
	private Date modified_time; /** 修改时间*/

	// @DBRef 引用对象其他表
	// private MdmEnrollment parent;

	public Page<MdmEnrollment> findByPageable(Pageable pageable, MdmEnrollment mdmEnrollment) {
		return this.getEntityRepository().findAll(pageable);
	}

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	public String getUdid() {
		return udid;
	}

	public void setUdid(String udid) {
		this.udid = udid;
	}

	public String getTopic() {
		return topic;
	}

	public void setTopic(String topic) {
		this.topic = topic;
	}

	public String getPushMagic() {
		return pushMagic;
	}

	public void setPushMagic(String pushMagic) {
		this.pushMagic = pushMagic;
	}
	
	public byte[] getByteToken() {
		return byteToken;
	}

	public void setByteToken(byte[] byteToken) {
		this.byteToken = byteToken;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public byte[] getUnlockToken() {
		return unlockToken;
	}

	public void setUnlockToken(byte[] unlockToken) {
		this.unlockToken = unlockToken;
	}

	public Date getCreate_time() {
		return create_time;
	}

	public void setCreate_time(Date create_time) {
		this.create_time = create_time;
	}

	public Date getModified_time() {
		return modified_time;
	}

	public void setModified_time(Date modified_time) {
		this.modified_time = modified_time;
	}
}
